#ifndef __CONFLOADER_HEADER
#define __CONFLOADER_HEADER

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <vector>
#include <string>

#define LOAD_OK 			0
#define LOAD_OJ_CONF_ERROR 	1

class ConfLoader {
private:
	std::vector<std::string> oj;
public:
	int load();
	std::vector<std::string> get_oj_vector();
};

int ConfLoader::load() {
	FILE *fp = fopen("../conf/oj.txt", "r");
	if (fp == NULL) 
		return LOAD_OJ_CONF_ERROR;
	char str[50];
	while (fgets(str, 50, fp)) {
		str[strlen(str)-1] = '\0';
		oj.push_back(str);
	}
	fclose(fp);
	return LOAD_OK;
}

std::vector<std::string> ConfLoader::get_oj_vector() {
	return oj;
}

#endif // __CONFLOADER_HEADER
